#pragma once

#include <map>
#include <mutex>
#include <functional>
#include "Util/util.h"
#include "jsoncpp/json.h"
#include "Network/Buffer.h"

using namespace std;
using namespace Fdt;
class FtpServer{
public:
    static FtpServer *instance();
private:
    FtpServer();
    ~FtpServer();
    void RegistRPC();
    bool GetSavePath(const Json::Value &request, const Fdt::BufferMap::Ptr &inMap, Json::Value &response, Fdt::BufferMap::Ptr &outMap);
    bool TrackFile(const Json::Value &request, const Fdt::BufferMap::Ptr &inMap, Json::Value &response, Fdt::BufferMap::Ptr &outMap);
    bool DigitalSignageFile(std::string &path);
private:
    static FtpServer *sm_FtpServer;
    static mutex sm_instanceLock;
    std::string m_streamerPath;
    std::string m_rootPath;
};
